package com.wanshi.cloud.controller;


import com.wanshi.cloud.service.IProductService;
import com.wanshi.cloud.utils.base.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 顽石教育-www.wanshi.com
 * @since 2021-09-02
 */
@RestController
@RequestMapping("/product")
public class ProductController {

    @Autowired
    private IProductService productService;

    //根据id查商品
    @GetMapping("/{id}")
    private Result findById(@PathVariable Integer id){
        return Result.ok(productService.getById(id));
    }
}
